#ifndef GAMEINTERFACE_H
#define GAMEINTERFACE_H

#include <QtWidgets/qwidget.h>
#include "basicinterface.h"
#include "../GameEngine/minion.h"

class GameInterface : public QWidget, public BasicInterface
{
    Q_OBJECT

    int ViewX, ViewY;
    int ReferenceX, ReferenceY;
    bool CenterView;

private:
    void NormalizeView();
    void FocusOnMinion();
    void GetVisibleMinions(QVector<Minion *> &VisibleMinions, QVector<Minion *> &PartiallyVisible);
    void DrawBackground(QPainter &painter, QVector<Minion *> &VisibleMinions);
    void DrawMinions(QPainter &painter, QVector<Minion *> &VisibleMinions, QVector<Minion *> &PartiallyVisible);
    void DrawMinionsSprites(QPainter &painter, QVector<Minion *> &VisibleMinions);
    void DrawPartiallyVisibleSprites(QPainter &painter, QVector<Minion*> &PartiallyVisible);
    void DrawMinionsInfoBars(QPainter &painter, QVector<Minion *> &VisibleMinions);
    void DrawBullets(QPainter &painter);
    void DrawMinionMarkers(QPainter &painter, Minion *CurrentMinion);
    void DrawMinionBase(QPainter &painter, Minion *CurrentMinion);
    void DrawMinionTurret(QPainter &painter, Minion *CurrentMinion);
    void DrawMessage(QPainter &painter);

public:
    GameInterface();

    void paintEvent(QPaintEvent *);
    void mousePressEvent(QMouseEvent *e);
    void mouseMoveEvent(QMouseEvent *e);
    void keyPressEvent(QKeyEvent *e);
};

#endif // GAMEINTERFACE_H
